package com.controller;

import com.domain.User;
import com.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("test")
public class TestController {

    @Autowired
    TestService testService;

    @RequestMapping("/hello")
    @ResponseBody
    public String hello() {
        return "hello";
    }


    @RequestMapping("/getUserById")
    @ResponseBody
    public User getUser() {
        return testService.getById(18);
    }


}
